<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	<h:form prependId="false" id="growlForm">
		<p:growl id="growl" showDetail="false" />
	</h:form>
	<h:form prependId="false" id="accountDataForm">
		<p:panel id="accountData" toggleable="true" toggleSpeed="250">
			<f:facet name="header">
				<h:outputText value="#{messages.label_accounts}" />
			</f:facet>
			<h:outputFormat id="noRecordsFound"
				value="#{messages.label_no_records_found}"
				rendered="#{empty accountBean.accounts}">
				<f:param value="Accounts" />
			</h:outputFormat>
			<p:dataTable id="list" value="#{accountBean.accounts}"
				var="account" rendered="#{!empty accountBean.accounts}"
				resizableColumns="false" paginator="false">

				<p:column id="accountTypeCol"
					headerText="#{messages.label_accounttype}">
					<h:outputText value="#{account.type}" />
				</p:column>

				<p:column id="accountNoCol" headerText="#{messages.label_accountno}">
					<h:outputText value="#{account.accountNumber}" />
				</p:column>

				<p:column id="amountCol" headerText="#{messages.label_amount}">
					<h:outputText value="#{account.bookedValue}"
						converter="currencyConverter" />
				</p:column>

				<p:column styleClass="action-column">
					<f:facet name="header">
						<h:outputText value="Actions" />
					</f:facet>
					<p:commandButton id="viewButton" icon="ui-icon-zoomin"
						update=":viewForm:viewPanelGrid"
						oncomplete="viewDialogWidget.show()"
						title="#{messages.label_view}">
						<f:setPropertyActionListener value="#{account}"
							target="#{accountBean.account}" />
					</p:commandButton>
					<p:tooltip for="viewButton" value="#{messages.label_view}"
						showEffect="fade" hideEffect="fade" />
					<p:commandButton id="viewTransactionsButton" icon="ui-icon-zoomin"
						action="#{accountBean.findTransactionsByAccountNumber}"
						update=":transactionForm"
						oncomplete="viewTransactionsDialogWidget.show()"
						title="#{messages.label_view}">
						<f:setPropertyActionListener value="#{account}"
							target="#{accountBean.account}" />
					</p:commandButton>
					<p:tooltip for="viewTransactionsButton"
						value="#{messages.label_viewtransactions}" showEffect="fade"
						hideEffect="fade" />

				</p:column>
			</p:dataTable>
			<h:panelGrid columns="2">
				<h:outputText value="#{messages.label_total_booked_value}:" />
				<h:outputText value="#{accountBean.bookedValueTotal}" />
			</h:panelGrid>
		</p:panel>
	</h:form>
</ui:composition>